﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;

public class SolMihayo3
{

    public int Winner(int[] inDeg, IList<IList<int>> edge,int x)
    {
        bool Xiaoyo=false;
        int res = -1;

        for (int i = 1; i < inDeg.Length; i++)
        {
            if (inDeg[i] == 1)
            {
                res = 1;

            }
        }
        if (res == -1)
        {
            return 3;
        }
        for (int i = 0; i < edge.Count; i++)

        {
            Console.WriteLine(i+"的临边有");
            for (int j = 0; j < edge[i].Count; j++)
            {
                Console.Write(edge[i][j] + "   ");
            }
            Console.WriteLine();

        }

       
        while (inDeg[x] != 0)
        {
            //先找入度为1的
            for (int i = 1; i < inDeg.Length; i++)
            {
                Console.WriteLine(i+"   inDeg[i]   "+ inDeg[i]);
                if (inDeg[i] == 1)
                {
                    Xiaoyo = !Xiaoyo;
                    inDeg[i]--;
                    Console.WriteLine("i"+i);
                    int nextNode = edge[i][0];
                    inDeg[nextNode]--;


                }
            }


        }

        
        if (Xiaoyo) {

            return 1;
        }
        else
        {
            return 2;
        }

        
    }
}
public class ProgramMihayo3
{
    public static void MainMihayo3()
    {
        string line;


        while ((line = Console.ReadLine()) != null)
        {
            string[] tokens = line.Split();

            int t = int.Parse(tokens[0]);

            for (int i = 0; i < t; i++) {
                line = Console.ReadLine();
                tokens = line.Split();
                int n = int.Parse(tokens[0]);//边的数量=点的数量=n
                int x = int.Parse(tokens[1]);
                int[] inDeg= new int[n+1];//结点是从1开始数的
                //邻接表
                IList<IList<int>> edge = new List<IList<int>>();
                for (int e = 0; e <= n; e++)
                {
                    edge.Add(new List<int>());
                }
                for (int j = 0; j < n; j++)
                {


                    line = Console.ReadLine();
                    tokens = line.Split();
                    int vi = int.Parse(tokens[0]);
                    int vj = int.Parse(tokens[1]);
                    edge[vi].Add(vj);
                    edge[vj].Add(vi);
                    //入度加1
                    inDeg[vi]++;
                    inDeg[vj]++;
}
                SolMihayo3 sol= new SolMihayo3();
               int winner= sol.Winner(inDeg, edge,x);
                if (winner==1)
                {
                    Console.WriteLine("Xiaoyo");
                }
                else if (winner == 2)
                {
                    Console.WriteLine("Pyrmont");
                }
                else
                {
                    Console.WriteLine("Draw");
                }

             

            }



            





        }
    }
}
//输入，几个图，3，4个点，获胜点是2，后面是边的连接关系
//3
//4 2
//1 2
//1 3
//1 4
//3 4
//5 2
//1 2
//1 3
//1 4
//3 4
//5 2
//3 1
//1 2
//1 3
//2 3